<template>
    <div>
        <swiper :options="swiperOption" v-if="list.length">
            <!-- slides -->
            <swiper-slide v-for="item of list" :key="item.id">
                <img class="swiper-image" :src="item.imgUrl">
            </swiper-slide>
            <!-- Optional controls -->
            <div class="swiper-pagination" slot="pagination"></div>
            <div class="swiper-button-prev" slot="button-prev"></div>
            <div class="swiper-button-next" slot="button-next"></div>
        </swiper>
    </div>
</template>

<script>
export default {
    props: {
      list: Array
    },
    data () {
        return {
            swiperOption: {
                pagination: '.swiper-pagination',
                loop: true
            },
        }
    }
}
</script>

<style lang="stylus" scoped>
.swiper-image
    width: 100%
.swiper-pagination >>> .swiper-pagination-bullet-active
    background-color: #ffff0f
</style>
